package com.shop.shoppojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.parameters.P;

import java.beans.Transient;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
 * 商品实体类
 */
public class Category implements Serializable {
    // 序列化版本号
    @Serial
    private static final long serialVersionUID = 1L;
    //商品id
    private Long id;
    //商品名
    private String name;
    //商品图片
    private String externalUrl;
    //商品父id
    private Long parentId;
    //商品层数
    private Long level;
    // 商品id
    private Long goodsId;

//    @TableField(exist = false)
//    private List<Category> children;
//    public String getParentId() {
//        return parentId!= null? parentId : ""; // 或者根据业务逻辑返回一个合适的默认值
//    }

}
